Optimal. Leaf size=103 \[ \frac {1}{2} \left (2 A b^2+a^2 (A+2 C)\right ) x+\frac {2 a b C \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a A b \sin (c+d x)}{d}+\frac {A \cos (c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}-\frac {b^2 (A-2 C) \tan (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.20, antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {4180, 4161,
4132, 8, 4130, 3855} \begin {gather*} \frac {1}{2} x \left (a^2 (A+2 C)+2 A b^2\right )+\frac {a A b \sin (c+d x)}{d}+\frac {A \sin (c+d x) \cos (c+d x) (a+b \sec (c+d x))^2}{2 d}+\frac {2 a b C \tanh ^{-1}(\sin (c+d x))}{d}-\frac {b^2 (A-2 C) \tan (c+d x)}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3855
Rule 4130
Rule 4132
Rule 4161
Rule 4180
Rubi steps
\begin {align*} \int \cos ^2(c+d x) (a+b \sec (c+d x))^2 \left (A+C \sec ^2(c+d x)\right ) \, dx &=\frac {A \cos (c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}+\frac {1}{2} \int \cos (c+d x) (a+b \sec (c+d x)) \left (2 A b+a (A+2 C) \sec (c+d x)-b (A-2 C) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {A \cos (c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}-\frac {b^2 (A-2 C) \tan (c+d x)}{2 d}+\frac {1}{2} \int \cos (c+d x) \left (2 a A b+\left (2 A b^2+a^2 (A+2 C)\right ) \sec (c+d x)+4 a b C \sec ^2(c+d x)\right ) \, dx\\ &=\frac {A \cos (c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}-\frac {b^2 (A-2 C) \tan (c+d x)}{2 d}+\frac {1}{2} \int \cos (c+d x) \left (2 a A b+4 a b C \sec ^2(c+d x)\right ) \, dx+\frac {1}{2} \left (2 A b^2+a^2 (A+2 C)\right ) \int 1 \, dx\\ &=\frac {1}{2} \left (2 A b^2+a^2 (A+2 C)\right ) x+\frac {a A b \sin (c+d x)}{d}+\frac {A \cos (c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}-\frac {b^2 (A-2 C) \tan (c+d x)}{2 d}+(2 a b C) \int \sec (c+d x) \, dx\\ &=\frac {1}{2} \left (2 A b^2+a^2 (A+2 C)\right ) x+\frac {2 a b C \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a A b \sin (c+d x)}{d}+\frac {A \cos (c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}-\frac {b^2 (A-2 C) \tan (c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.80, size = 130, normalized size = 1.26 \begin {gather*} \frac {2 \left (2 A b^2+a^2 (A+2 C)\right ) (c+d x)-8 a b C \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+8 a b C \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+8 a A b \sin (c+d x)+\left (a^2 A+4 b^2 C+a^2 A \cos (2 (c+d x))\right ) \tan (c+d x)}{4 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 94, normalized size = 0.91
method | result | size |
derivativedivides | \(\frac {A \,b^{2} \left (d x +c \right )+b^{2} C \tan \left (d x +c \right )+2 a A b \sin \left (d x +c \right )+2 a b C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+A \,a^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a^{2} C \left (d x +c \right )}{d}\) | \(94\) |
default | \(\frac {A \,b^{2} \left (d x +c \right )+b^{2} C \tan \left (d x +c \right )+2 a A b \sin \left (d x +c \right )+2 a b C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+A \,a^{2} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a^{2} C \left (d x +c \right )}{d}\) | \(94\) |
risch | \(\frac {a^{2} A x}{2}+x A \,b^{2}+x \,a^{2} C -\frac {i A \,a^{2} {\mathrm e}^{2 i \left (d x +c \right )}}{8 d}-\frac {i a A b \,{\mathrm e}^{i \left (d x +c \right )}}{d}+\frac {i a A b \,{\mathrm e}^{-i \left (d x +c \right )}}{d}+\frac {i A \,a^{2} {\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}+\frac {2 i b^{2} C}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {2 b a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{d}-\frac {2 b a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{d}\) | \(160\) |
norman | \(\frac {\left (-\frac {1}{2} A \,a^{2}-A \,b^{2}-a^{2} C \right ) x +\left (-\frac {1}{2} A \,a^{2}-A \,b^{2}-a^{2} C \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {1}{2} A \,a^{2}+A \,b^{2}+a^{2} C \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {1}{2} A \,a^{2}+A \,b^{2}+a^{2} C \right ) x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-A \,a^{2}-2 A \,b^{2}-2 a^{2} C \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (A \,a^{2}+2 A \,b^{2}+2 a^{2} C \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {2 \left (3 A \,a^{2}-2 b^{2} C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (A \,a^{2}-4 a A b +2 b^{2} C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (A \,a^{2}+4 a A b +2 b^{2} C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {4 a A \left (a -2 b \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {4 a A \left (a +2 b \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}-\frac {2 a b C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}+\frac {2 a b C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}\) | \(389\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 99, normalized size = 0.96 \begin {gather*} \frac {{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a^{2} + 4 \, {\left (d x + c\right )} C a^{2} + 4 \, {\left (d x + c\right )} A b^{2} + 4 \, C a b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 8 \, A a b \sin \left (d x + c\right ) + 4 \, C b^{2} \tan \left (d x + c\right )}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.22, size = 119, normalized size = 1.16 \begin {gather*} \frac {2 \, C a b \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - 2 \, C a b \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + {\left ({\left (A + 2 \, C\right )} a^{2} + 2 \, A b^{2}\right )} d x \cos \left (d x + c\right ) + {\left (A a^{2} \cos \left (d x + c\right )^{2} + 4 \, A a b \cos \left (d x + c\right ) + 2 \, C b^{2}\right )} \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (A + C \sec ^{2}{\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right )^{2} \cos ^{2}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.47, size = 175, normalized size = 1.70 \begin {gather*} \frac {4 \, C a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 4 \, C a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {4 \, C b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1} + {\left (A a^{2} + 2 \, C a^{2} + 2 \, A b^{2}\right )} {\left (d x + c\right )} - \frac {2 \, {\left (A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 4 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 4 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2}}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.77, size = 193, normalized size = 1.87 \begin {gather*} \frac {C\,b^2\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}+\frac {2\,A\,a\,b\,\sin \left (c+d\,x\right )}{d}+\frac {A\,a^2\,\cos \left (c+d\,x\right )\,\sin \left (c+d\,x\right )}{2\,d}-\frac {A\,a^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,1{}\mathrm {i}}{d}-\frac {A\,b^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}}{d}-\frac {C\,a^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}}{d}-\frac {C\,a\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,4{}\mathrm {i}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________